/*** 
 * @Date: 2020-07-09 18:10:59
 * @LastEditors: leehave
 * @LastEditTime: 2020-09-05 15:47:08
 */
/*** 
 * @Date: 2020-07-09 18:10:59
 * @LastEditors: leehave
 * @LastEditTime: 2020-08-13 10:05:58
 */
 import qs from 'qs'
 import request from '@/utils/request'
 import store from '@/store'
 import { PORT } from './api'
 import axios from 'axios'
 import { objectConvertToQuery } from '@/utils/index'
 /**
  * 服务分类
  */
 export function serverClassicOption() {
   return request({
     url: PORT.nurseOption,
     method: 'get',
   })
 }
 
 /**
  * 护理到家列表
  * @params {expand}
  */
 export function nurseItemServer(params){
  let url = objectConvertToQuery(params)
   return request({
     url: PORT.nurseItem + url,
     method: 'get',
     data: params
   })
 }
 /**
  * 护理详情
  */
 export function nurseItemInfoServer(id){
   return request({
     url: PORT.nurseItem + '/' + id + '?expand=comment',
     method: 'get',
   })
 }
  /**
  * 护理详情不带评价数据
  */
 export function nurseInfoServer(id){
  return request({
    url: PORT.nurseItem + '/' + id,
    method: 'get',
  })
}

 /**
  * 护理提交订单
  */
 export function nurseItemOrderServer(params){
   return request({
     url: PORT.order,
     method: 'post',
     data: qs.stringify(params)
   })
 }
/**
 * 根据返回的订单id调起支付
 */
export function nurseOrderPayment(params){
  let url = objectConvertToQuery(params)
  return request({
    url: PORT.order + '/wxpay' + url,
    method: 'post',
  })
}
 /**
  * 提交评价
  * @params {params}
  */
  export function nurseOrderServer(params){
    return request({
      url: PORT.nurseOrder,
      method: 'post',
      data: qs.stringify(params)
    })
  }
/**
  * 出生医学证明
  */
 export function birthProveServer(){
  return request({
    url: PORT.birthProve,
    method: 'get',
  })
}

/**
  * 体检列表
  */
 export function checksListServer(){
  return request({
    url: PORT.checkCheck,
    method: 'get',
  })
}
/**
  * 体检详情
  */
 export function checksInfoServer(id){
  return request({
    url: PORT.checkCheck + '/' + id,
    method: 'get',
  })
}

/**
  * 体检type
  */
 export function checksTypeServer(){
  return request({
    url: PORT.checkCheck + '/type',
    method: 'get',
  })
}



/**
  * 体检预约
  * @params {params}
  */
 export function checkLogsServer(params){
  return request({
    url: PORT.checkLogs,
    method: 'post',
    data: qs.stringify(params)
  })
}

/**
  * 就诊人列表
  */
 export function memberList(){
  return request({
    url: PORT.member,
    method: 'get',
  })
}

/**
  * 就诊人体检信息
  * @params {params}
  */
 export function memberServer(params){
  return request({
    url: PORT.member,
    method: 'post',
    data: qs.stringify(params)
  })
}
/**
  * 就诊人体检信息详情
  * @params {id}
  */
 export function memberInfoServer(id){
  return request({
    url: PORT.member + '/' + id,
    method: 'get',
  })
}
/**
  * 就诊人体检信息修改
  * @params {params，id}
  */
 export function memberEditServer(params,id){
  return request({
    url: PORT.member + '/' + id,
    method: 'put',
    data: qs.stringify(params)
  })
}

/**
  * 删除就诊人
  */
 export function memberDel(id){
  return request({
    url: PORT.member + '/' + id,
    method: 'delete',
  })
}
/**
  * 首页默认就诊人
  */
 export function memberDefaultService(){
  return request({
    url: PORT.memberDefault,
    method: 'get',
  })
}


/**
  * 产检时间表
  */
 export function contentTimesServer(){
  return request({
    url: PORT.contentTimes,
    method: 'get',
  })
}

/**
  * 产检详情
  */
 export function contentTimesInfoServer(id){
  return request({
    url: PORT.contentTimes + '/' + id,
    method: 'get',
  })
}

/**
  * 预产期
  */
 export function yuchanqiTimesServer(){
  return request({
    url: PORT.contentDates,
    method: 'get',
  })
}

/**
  * 修改添加预产期
  * @params {params}
  */
 export function contentTimesEditServer(params){
  return request({
    url: PORT.editDates,
    method: 'post',
    data: qs.stringify(params)
  })
}

/**
  * 药品价格
  */
 export function systemPrice(){
  return request({
    url: PORT.price,
    method: 'get',
  })
}

/**
  * 药品服务价格
  */
 export function systemMedicalsPrice(){
  return request({
    url: PORT.medicals,
    method: 'get',
  })
}

/**
  * 提交核酸信息
  * @params {params}
  */
 export function contentTestServer(params){
  return request({
    url: PORT.contentTest,
    method: 'post',
    data: qs.stringify(params)
  })
}

/**
  * 核酸选项
  */
 export function contentTestOptionService(){
  return request({
    url: PORT.contentTestOption,
    method: 'get',
  })
}